package module.edittroop.model.dataObj
{
	import code.obj.IconObj;
	
	import module.building.model.dataObj.EquipObj;

	public class ArmsConfigObj extends IconObj
	{
		public function ArmsConfigObj()
		{
			
		}
		override public function get iconClassName():String
			{
				return "MATERIAL_" + serverId + "_ICON";
			}
		public var range:int;
		public var eqipName:String;
		public var atk:int;
		public var crit:Number;
		public var iron:int;
		public var equipId:int;
		public var speed:int;
		public var def:int;
		public var gold:int;
		public var time:int;
		public var atkRate:int;
		public var stone:int;
		public var wood:int;
		public var armsName:String;
		public var skillList:Array;
		public var output:int;
		public var equip:EquipObj;
		/**
		 * {"range":"1","eqipName":"动员兵装备","atk":"900","armsId":"800001","crit":"0.1","iron":"1","equipId":"200001","speed":"24","def":"1234","gold":"1","time":"3","atkRate":"2","stone":"1","wood":"1","armsName":"动员兵","skillList":"","output":"1"},
		 * @param data
		 * @return 
		 * 
		 */		
		public static function praseData(data:Object):ArmsConfigObj
		{
			var $armsConfigObj:ArmsConfigObj = new ArmsConfigObj();
			$armsConfigObj.serverId =data.serverId
			$armsConfigObj.armsName = data.armsName;
			$armsConfigObj.atk = data.atk;
			$armsConfigObj.atkRate = data.atkRate;
			$armsConfigObj.crit = data.crit;
			$armsConfigObj.def = data.def;
			$armsConfigObj.eqipName = data.eqipName;
			$armsConfigObj.equipId = data.equipId;
			$armsConfigObj.gold = data.gold;
			$armsConfigObj.iron = data.iron;
			$armsConfigObj.output = data.output;
			$armsConfigObj.range = data.range;
//			$armsConfigObj.skillList = String(data.skillList).split(",");
			$armsConfigObj.speed = data.speed;
			$armsConfigObj.stone = data.stone;
			$armsConfigObj.time = data.time;
			$armsConfigObj.wood = data.wood;
			$armsConfigObj.equip = EquipObj.praseData(data);
			return $armsConfigObj;
		}
	}
}